﻿<%@ page contentType="text/html; charset=gbk" language="java" %>

<% 
	String context = request.getContextPath();
	
	String treeDir = context + ConfigUtil.getTreeDir();
	
%>


<%@page import="component.tree.util.ConfigUtil"%><head>

<head>	

	<script type="text/javascript" src="<%=treeDir%>/js/package.js"></script>
	<script type="text/javascript" src="<%=treeDir%>/js/Component.js"></script>
	
</head>

<body>

<form action="/component.do" method="post">
	
	<input type="hidden" name="orgId" id="orgId" />
	<input type="text" name="orgName" id="orgName" />
	<input type="button" value="选择单位" onclick="toOrgSelect()" />
	
	
	<input type="hidden" name="fundsrcId" id="fundsrcId" />
	<input type="text" name="fundsrcName" id="fundsrcName" />
	<input type="button" value="选择资金来源" onclick="toFundsrcSelect()" />
	
	<input type="hidden" name="outlayTypeId" id="outlayTypeId" />
	<input type="text" name="outlayTypeName" id="outlayTypeName" />
	<input type="button" value="选择经费类型" onclick="toOutlayTypeSelect()" />
	
	<input type="hidden" name="subjId" id="subjId" />
	<input type="text" name="subjName" id="subjName" />
	<input type="button" value="选择功能科目" onclick="toSubjSelect()" />

</form>

</body>


<script type="text/javascript">

		//单位选择：单位表的fpath不符合树型的规范，所以不能进行搜索 
		var orgTreeObj = new component.Component("<%=context%>","orgTreeObj");
		orgTreeObj.paras += "&componentId=SMG_TORGANIZATION&title=单位";
		orgTreeObj.paras += "&isLoadAll=true";//一次性加载
		orgTreeObj.paras += "&isSearch=false";//去掉搜索功能
		
		orgTreeObj.condition = " and fyear = '2008' and fzt_id = 1001 ";//单位的条件
		
		function toOrgSelect(){
			orgTreeObj.toTreeSelect();
		}

		function orgTreeObj_doAfterSelect(selectTreeMap){
			var name = selectTreeMap.get("name");
			if(name=="undefined" || name==null) name = "";
			
			var id = selectTreeMap.get("id");
			if(id=="undefined" || name==null) id = "";
			
			document.getElementById("orgName").value = name;
			document.getElementById("orgId").value = id;
		}
		function orgTreeObj_doClear(){								
			document.getElementById("orgName").value = "";
			document.getElementById("orgId").value = "";						
		}
		
	</script>
	
	
	
	<script type="text/javascript">

		var fundsrcTreeObj = new component.Component("<%=context%>","fundsrcTreeObj");
		fundsrcTreeObj.paras += "&componentId=TFM_PB_TFUNDSRC&title=";
		fundsrcTreeObj.paras += "&isLoadAll=true";//一次性加载
		fundsrcTreeObj.paras += "&isUseLines=true";//使用连线
		fundsrcTreeObj.paras += "&isSelectMore=true";//多选
		
		function toFundsrcSelect(){
			fundsrcTreeObj.toTreeSelect();
		}

		function fundsrcTreeObj_doAfterSelect(selectTreeMap){
			var name = selectTreeMap.get("name");
			if(name=="undefined" || name==null) name = "";
			
			var id = selectTreeMap.get("id");
			if(id=="undefined" || name==null) id = "";
			
			document.getElementById("fundsrcName").value = name;
			document.getElementById("fundsrcId").value = id
		}
		function fundsrcTreeObj_doClear(){								
			document.getElementById("fundsrcName").value = "";
			document.getElementById("fundsrcId").value = "";						
		}
		
	</script>
	
	<script type="text/javascript">

		var outlayTypeTreeObj = new component.Component("<%=context%>","outlayTypeTreeObj");
		outlayTypeTreeObj.paras += "&componentId=TFM_PB_TOUTLAYTYPE&title=";
		outlayTypeTreeObj.paras += "&isLoadAll=true";//一次性加载
		outlayTypeTreeObj.paras += "&isUseLines=true";//使用连线
		outlayTypeTreeObj.paras += "&isUseIcons=true";//使用图片
		outlayTypeTreeObj.paras += "&isSelectMore=true";//多选
		outlayTypeTreeObj.paras += "&isSelectFolder=true";//是否能够选择目录
		outlayTypeTreeObj.paras += "&firstShowLevel=3";//树型初始显示到第3层
		
		function toOutlayTypeSelect(){
			outlayTypeTreeObj.toTreeSelect();
		}

		function outlayTypeTreeObj_doAfterSelect(selectTreeMap){
			var name = selectTreeMap.get("name");
			if(name=="undefined" || name==null) name = "";
			
			var id = selectTreeMap.get("id");
			if(id=="undefined" || name==null) id = "";
			
			document.getElementById("outlayTypeName").value = name;
			document.getElementById("outlayTypeId").value = id
		}
		function outlayTypeTreeObj_doClear(){								
			document.getElementById("outlayTypeName").value = "";
			document.getElementById("outlayTypeId").value = "";						
		}
		
	</script>
	
	<script type="text/javascript">

		var subjTreeObj = new component.Component("<%=context%>","subjTreeObj");
		subjTreeObj.paras += "&componentId=TFM_PB_TSUBJ&title=&isLoadAll=";
		
		function toSubjSelect(){
			subjTreeObj.toTreeSelect();
		}

		function subjTreeObj_doAfterSelect(selectTreeMap){
			var name = selectTreeMap.get("name");
			if(name=="undefined" || name==null) name = "";
			
			var id = selectTreeMap.get("id");
			if(id=="undefined" || name==null) id = "";
			
			document.getElementById("subjName").value = name;
			document.getElementById("subjId").value = id
		}
		function subjTreeObj_doClear(){								
			document.getElementById("subjName").value = "";
			document.getElementById("subjId").value = "";						
		}
		
	</script>